export default class RandomTool {
  /**
   * 攻击序列的随机数 为了保证一开始预览的攻击次序和后面实际的攻击次序相等
   */
  public static rIndex: number;
  public static arr: number[];
  public static arr_init(arr: number[]): void {
    this.arr = arr;
    this.rIndex = 0;
  }
  public static getRandom(): number {
    //let num:number = Math.random();
    let num: number = this.arr[this.rIndex];
    this.rIndex++;
    this.rIndex = this.rIndex>this.arr.length-1?0:this.rIndex;
    return num;
  }
}
